import VueRouter from 'vue-router'

// 导入导航组件
import homeComponent from './vueComponents/homeComponent.vue';
import menberComponent from './vueComponents/menberComponent.vue';
import shopcarComponent from './vueComponents/shopcarComponent.vue';
import searchComponent from './vueComponents/searchComponent.vue';
import newsList from './vueComponents/homeList/newsList.vue';
import newsInfo from './vueComponents/homeList/newsInfo.vue';
import photoHome from './vueComponents/homeList/photo/photoHome.vue';
import photoDetails from './vueComponents/homeList/photo/photoDetails.vue';
import handsetShop from './vueComponents/homeList/shop/handsetShop.vue';
import shopInfo from './vueComponents/homeList/shop/shopInfo.vue';
import goodsDesc from './vueComponents/homeList/shop/goodsDesc.vue';
import goodsComment from './vueComponents/homeList/shop/goodsComment.vue';
// 3. 创建路由对象
var router = new VueRouter({
  routes: [
		{path: '/', redirect: '/home'},
		{path: '/home', component: homeComponent},
		{path: '/member', component: menberComponent},
		{path: '/shopcar', component: shopcarComponent},
		{path: '/search', component: searchComponent},
		{path: '/home/newsList', component: newsList},
		{path: '/home/newsInfo/:id', component: newsInfo},
		{path: '/home/photoHome', component: photoHome},
		{path: '/home/photoDetails/:id', component: photoDetails},
		{path: '/home/handsetShop', component: handsetShop},
		{path: '/home/shopInfo/:id', component: shopInfo},
		{path: '/home/goodsDesc/:id', component: goodsDesc},
		{path: '/home/goodsComment/:id', component: goodsComment}
  ],
	linkActiveClass: 'mui-active'  //设置当前路由的类，此处用于实现路由高亮
})

// 把路由对象暴露出去
export default router
